package cn.kgm.article.server.struct;

import cn.kgm.article.dto.dto.ArticleInfoSaveDTO;
import cn.kgm.article.dto.dto.ArticleInfoUpdateDTO;
import cn.kgm.article.dto.query.ArticleInfoPageQuery;
import cn.kgm.article.dto.vo.ArticleInfoVO;
import cn.kgm.article.server.entity.ArticleInfo;
import org.mapstruct.Builder;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * # 技术改变自己 #
 * @author kapi
 * @date 2024-03-15 14:33:45
 */
@Mapper(builder = @Builder(disableBuilder = true))
public interface ArticleInfoMappers {
    ArticleInfoMappers INSTANCE = Mappers.getMapper(ArticleInfoMappers.class);

    /**
     * 将 ArticleInfoSaveDTO 映射成 ArticleInfo 对象
     *
     * @param source 源对象
     * @return ArticleInfo
     */
    ArticleInfo mapToEntity(ArticleInfoSaveDTO source);

    /**
     * 将 ArticleInfoUpdateDTO 映射成 ArticleInfo 对象
     *
     * @param source 源对象
     * @return ArticleInfo
     */
    ArticleInfo mapToEntity(ArticleInfoUpdateDTO source);

    /**
     * ArticleInfoPageQuery 映射成 ArticleInfo 对象
     *
     * @param source 源对象
     * @return ArticleInfo
     */
    ArticleInfo mapToEntity(ArticleInfoPageQuery source);

    /**
     * ArticleInfoPageQuery 映射成 ArticleInfo 对象
     *
     * @param source 源对象
     * @return ArticleInfoVO
     */
    ArticleInfoVO mapToEntity(ArticleInfo source);

}
